package com.pkx.cloud.fse7.dms.grant.service.impl;

import com.pkx.cloud.fse7.dms.grant.entity.DmsGrant;
import com.pkx.cloud.fse7.dms.grant.repo.DmsGrantMapper;
import com.pkx.cloud.fse7.dms.grant.service.DmsGrantService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 *  服务实现类
 *
 * @author chenwg
 * @since 2020-11-12
 */
@Service
public class DmsGrantServiceImpl extends ServiceImpl<DmsGrantMapper, DmsGrant> implements DmsGrantService {

    /**
     * 分页列表
     *
     * @param dmsGrant
     * @return
     */
    @Override
    public Page<DmsGrant> pageList(Page page, DmsGrant dmsGrant) {
        LambdaQueryWrapper<DmsGrant> lambdaQueryWrapper = Wrappers.lambdaQuery(DmsGrant.class);
        return page(page, lambdaQueryWrapper);
    }

    /**
     * 列表查询
     *
     * @param dmsGrant
     * @return
     */
    @Override
    public List<DmsGrant> listByEntity(DmsGrant dmsGrant) {
        LambdaQueryWrapper<DmsGrant> lambdaQueryWrapper = Wrappers.lambdaQuery(DmsGrant.class);
        return list(lambdaQueryWrapper);
    }

    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public DmsGrant selectById(Long id) {
        return getById(id);
    }

    /**
     * 保存
     *
     * @param dmsGrant
     * @return
     */
    @Override
    public Boolean saveDmsGrant(DmsGrant dmsGrant) {
        return save(dmsGrant);
    }

    /**
     * 修改
     *
     * @param dmsGrant
     * @return
     */
    @Override
    public Boolean modify(DmsGrant dmsGrant) {
        return updateById(dmsGrant);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Override
    public Boolean deleteById(Long id) {
        return removeById(id);
    }
}
